package com.ruoyi.supermarket.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.supermarket.mapper.SupermarketShelfMapper;
import com.ruoyi.supermarket.domain.SupermarketShelf;
import com.ruoyi.supermarket.service.ISupermarketShelfService;

/**
 * 超市货架信息Service业务层处理
 * 
 * @author faye
 * @date 2024-05-25
 */
@Service
public class SupermarketShelfServiceImpl implements ISupermarketShelfService 
{
    @Autowired
    private SupermarketShelfMapper supermarketShelfMapper;

    /**
     * 查询超市货架信息
     * 
     * @param shelfId 超市货架信息主键
     * @return 超市货架信息
     */
    @Override
    public SupermarketShelf selectSupermarketShelfByShelfId(Long shelfId)
    {
        return supermarketShelfMapper.selectSupermarketShelfByShelfId(shelfId);
    }

    /**
     * 查询超市货架信息列表
     * 
     * @param supermarketShelf 超市货架信息
     * @return 超市货架信息
     */
    @Override
    public List<SupermarketShelf> selectSupermarketShelfList(SupermarketShelf supermarketShelf)
    {
        return supermarketShelfMapper.selectSupermarketShelfList(supermarketShelf);
    }

    /**
     * 新增超市货架信息
     * 
     * @param supermarketShelf 超市货架信息
     * @return 结果
     */
    @Override
    public int insertSupermarketShelf(SupermarketShelf supermarketShelf)
    {
        supermarketShelf.setCreateTime(DateUtils.getNowDate());
        return supermarketShelfMapper.insertSupermarketShelf(supermarketShelf);
    }

    /**
     * 修改超市货架信息
     * 
     * @param supermarketShelf 超市货架信息
     * @return 结果
     */
    @Override
    public int updateSupermarketShelf(SupermarketShelf supermarketShelf)
    {
        supermarketShelf.setUpdateTime(DateUtils.getNowDate());
        return supermarketShelfMapper.updateSupermarketShelf(supermarketShelf);
    }

    /**
     * 批量删除超市货架信息
     * 
     * @param shelfIds 需要删除的超市货架信息主键
     * @return 结果
     */
    @Override
    public int deleteSupermarketShelfByShelfIds(Long[] shelfIds)
    {
        return supermarketShelfMapper.deleteSupermarketShelfByShelfIds(shelfIds);
    }

    /**
     * 删除超市货架信息信息
     * 
     * @param shelfId 超市货架信息主键
     * @return 结果
     */
    @Override
    public int deleteSupermarketShelfByShelfId(Long shelfId)
    {
        return supermarketShelfMapper.deleteSupermarketShelfByShelfId(shelfId);
    }
}
